package com.learn.springboot3;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.model.Info;
import com.github.dockerjava.core.DockerClientBuilder;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class test3 {

    public static void main(String[] args) throws IOException {
//
//
//        StringBuffer stringBuffer = new StringBuffer();
//        FileInputStream is = new FileInputStream("D:\\资料\\firewall.txt");
//        FileOutputStream os = new FileOutputStream("D:\\资料\\firewall2.txt");
//        byte[] bytes = new byte[1024];
//        int i ;
//        while ((i=is.read(bytes))!=-1){
//           // System.out.print(new String(bytes,0,i));
//
//            stringBuffer.append(new String(bytes,0,i));
//        }
//        is.close();
//
//        System.out.println("stringBuffer = " + stringBuffer);
//
//        String regex = "(\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/([0-9]{1,2}))\\b";
//        Pattern pattern = Pattern.compile(regex);
//        Matcher matcher = pattern.matcher(stringBuffer);
//
//
//        ArrayList<String> subnets = new ArrayList<>();
//
//        while (matcher.find()) {
//            subnets.add(matcher.group());
//        }
//
//        for (String subnet : subnets) {
//            System.out.println(subnet);
//            os.write(subnet.getBytes());
//            os.write(",\r\n".getBytes());
//        }
        }


}
